package edu.sctu.java.advanced.reflection.lab01;

import java.lang.reflect.InvocationTargetException;

public class Client {

    public static void main(String[] args) {

        User user = new User();
        user.setAge(12);
        user.setName("chen");


        try {
            Reflection reflection = new Reflection();
            User newUser = (User) reflection.copy(user);
//            User newUser = (User) Reflection.copy(user);


            System.out.println(newUser.getName() + newUser.getAge());
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (NoSuchMethodException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
        }

    }
}
